var myobj={
  SaleGood:{
    //代售的商品
    createNew:function (item) {
      let saleGood={};
      saleGood.goodModel=item==null?{}:item.goodModel || {};
      saleGood.num=item==null?{}:item.num || 1;
      saleGood.actualPrice=item==null?{}:item.actualPrice || 0;
      saleGood.totalPrice=item==null?{}:item.totalPrice || 0;
      saleGood.tags=[];
      return saleGood;
    }
  },
  FullMinus:{
    //当前销售单中的fullMinus活动状态
    createNew:function (item) {
      let fullMinus={};
      fullMinus.lv=item.lv;
      fullMinus.maxLV=item.maxLV || 0;
      fullMinus.id=item.id//活动编号
      fullMinus.total=0//满足此活动的总消费金额
      fullMinus.goodsBarcode=[]//当前销售记录中参与此活动的商品条码
      fullMinus.nowCondition=item.condition || 0//当前满足的活动条件
      fullMinus.nextCondition=item.nextCondition || 0//下一级未满足的条件
      fullMinus.cash=item.discount || 0//满减金额;
      fullMinus.freeGoods=[]//附赠商品的条码
      fullMinus.update=function (item) {
        fullMinus.lv=item.lv;
        fullMinus.nowCondition=item.condition;
        fullMinus.nextCondition=item.nextCondition;
        fullMinus.cash=item.discount || 0;
        fullMinus.freeGoods=item.freeGoodsList;
      }
      return fullMinus;
    },
  },
  FullMinusApply:{
    //活动申请类
    createNew:function (_discountList,_fullMinusList,_DiscountGoodList) {
      let fullMinusApply={};
      fullMinusApply.discountList=_discountList;
      fullMinusApply.fullMinusList=_fullMinusList;
      fullMinusApply.discountGoodList=_DiscountGoodList;
      return fullMinusApply;
    }
  },
  Discount:{
    createNew:function (_id,_end,_start,_targetGroup) {
      let discount={};
      discount.id=_id;
      discount.end=_end;
      discount.start=_start;
      discount.targetgroup=_targetGroup;
      return discount;
    }
  },
  FullMinusList:{
    createNew:function (_id,_condition,_discount,_freeGoodsList,_lv,_maxLV) {
      let fullMinusList={};
      fullMinusList.id=_id;
      fullMinusList.condition=_condition;//达标金额
      fullMinusList.discount=_discount || 0;//优惠金额
      fullMinusList.freeGoodsList=_freeGoodsList || [];
      fullMinusList.lv=_lv;
      fullMinusList.maxLV=_maxLV;
      return fullMinusList;
    }
  },
/*
  Employees:{
    createNew:function (_acount,_name,_Pcash,_Ppurchase,_Pplan,_Pimpower,_Proot,_identity,) {
      let employee={};
      //employee.staffId=_id||'';
      employee.account=_acount||'';
      employee.name=_name||'';
      employee.Pcash=_Pcash||false;
      employee.Ppurchase=_Ppurchase||false;
      employee.Pplan=_Pplan||false;
      employee.Pimpower=_Pimpower||false;
      employee.Proot=_Proot||false;
      employee.password='';
      return employee;
    }
  }*/
}
export default {myobj}
